package util.content;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class ChineseWordsCounter {

	public Boolean count(String s) {

		// true是中文占多数的行
		boolean charset = true;
		Pattern p = Pattern.compile("[\u4e00-\u9fa5]");
		Matcher m = p.matcher(s);
		int counter = 0;
		while (m.find()) {
			counter++;
		}		
		
		float t = s.trim().replaceAll(" ", "").length();
		//System.out.println(counter/t);
		if ((counter/t) < 0.2) {
			charset = false;
		}
		return charset;
	}

}
